package jtk.project4.fleet.field;

import java.awt.Dimension;

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.CalendarControl;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.ComboField;
import nl.coderight.jazz.form.field.SelectField;

public class PurchaseOrderField extends GroupControl {
	private SelectField<String> noPOField;
	private ComboField<String> receiptStatusField;
	private CalendarControl dateReceivedField;
	
	public PurchaseOrderField(String bindID){
		setTitle("header.PurchaseOrderField");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		noPOField = new ComboField<String>("noPO","noPO");
		noPOField.setPreferredSize(new Dimension(166,20));
		receiptStatusField = new ComboField<String>("PO Number","PO Number");
		receiptStatusField.setPreferredSize(new Dimension(166,20));
		dateReceivedField = new CalendarControl("Date", 20);
		dateReceivedField.setPreferredSize(new Dimension(166,20));
	}
	
	private void createLayout() {
		setLayout(new FormLayout())
		.addLabel("label.noPO")				.addField(noPOField)
		.addLabel("label.receiptStatus")	.addField(receiptStatusField)
		.addLabel("label.dateReceived")		.addField(dateReceivedField)
		.addRow()
		;
	}
}